Skip to content

[ui] Viewer2D: Add the pixel (x,y) values in the toolbar (editable)#2723

Merged
cbentejac merged 7 commits intodevelopfrom
feature/viewer2d-pixel-color-xy
May 20, 2025
Merged

[ui] Viewer2D: Add the pixel (x,y) values in the toolbar (editable)#2723
cbentejac merged 7 commits intodevelopfrom
feature/viewer2d-pixel-color-xy

Conversation

@nicolas-lambert-tc
Copy link
Copy Markdown
Contributor

Description

Add the ability to display and edit x, y value of the current rgba color displayed in the viewer2D.

viewer2d-xy

Features list

  • Add x and y text fields to viewer2D to display the pixel's coordinates
  • x and y can be edited by user to select a specific pixel

@nicolas-lambert-tc nicolas-lambert-tc self-assigned this May 14, 2025
@nicolas-lambert-tc nicolas-lambert-tc added feature new feature (proposed as PR or issue planned by dev) UI labels May 14, 2025
@nicolas-lambert-tc nicolas-lambert-tc added this to the Meshroom 2025.1.0 milestone May 14, 2025
@nicolas-lambert-tc nicolas-lambert-tc marked this pull request as ready for review May 14, 2025 12:42
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.84%. Comparing base (4f1e003) to head (663aeb8).
Report is 49 commits behind head on develop.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2723      +/-   ##
===========================================
+ Coverage    76.74%   76.84%   +0.10%     
===========================================
  Files           40       41       +1     
  Lines         6084     6132      +48     
===========================================
+ Hits          4669     4712      +43     
- Misses        1415     1420       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@cbentejac cbentejac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything works well as long as the mouse is hovering over the image.

If it is hovering in the 2D Viewer but outside of the image, the (x, y) coordinates display the last "recorded" position of the mouse on the image, but these displayed values do not correspond to the actual values of mousePosition and so the displayed RGB values are off as well. What seems to happen is that x and y are reset to 0 as soon as the mouse goes out of the image, the RGB values are updated to match the colors of pixel (0, 0), but the text fields for x and y still display the previous values. Modifying the values works, but for example, if I only modify x, y will still display the last recorded position while its value will actually still be 0.

Prior to this PR, the behaviour for RGB values was to display "--" when the mouse position was outside of the image. This can be discussed but I think we might want the same for the (x, y) coordinates: when hovering outside of the image, the values become "unset", and should the user choose to set them, only then would we display the corresponding RGB values.

Comment thread meshroom/ui/qml/Viewer/HdrImageToolbar.qml Outdated
Comment thread meshroom/ui/qml/Viewer/Viewer2D.qml Outdated
Copy link
Copy Markdown
Contributor

@cbentejac cbentejac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a remaining "issue" when the mouse is hovering outside of the picture: RGB values are still displayed while (x, y) are empty:
Screenshot_2025-05-19_15-02-09

Also, I think it'd be visually better if the (x, y) coordinates displayed "--" instead of nothing when the mouse isn't hovering over any pixel.

@nicolas-lambert-tc
Copy link
Copy Markdown
Contributor Author

nicolas-lambert-tc commented May 19, 2025

There's a remaining "issue" when the mouse is hovering outside of the picture: RGB values are still displayed while (x, y) are empty: Screenshot_2025-05-19_15-02-09

Also, I think it'd be visually better if the (x, y) coordinates displayed "--" instead of nothing when the mouse isn't hovering over any pixel.

I've added a placeholder to represent the '--' and expose it as a property to let the possibility to change it from outside.
image

…ouse hovered the image, to avoid ghost values
Copy link
Copy Markdown
Contributor

@cbentejac cbentejac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything's working functionally, just a few minor changes and we'll be good to go!

Comment thread meshroom/ui/qml/Viewer/HdrImageToolbar.qml Outdated
Comment thread meshroom/ui/qml/Viewer/HdrImageToolbar.qml Outdated
Comment thread meshroom/ui/qml/Viewer/HdrImageToolbar.qml Outdated
Comment thread meshroom/ui/qml/Viewer/HdrImageToolbar.qml Outdated
@cbentejac cbentejac force-pushed the feature/viewer2d-pixel-color-xy branch from 5ffdc67 to 278e95f Compare May 20, 2025 10:14
cbentejac and others added 2 commits May 20, 2025 12:15
Co-authored-by: nicolas-lambert-tc <nicolas.lambert@technicolor.com>
… be closer to usual usage

Co-authored-by: nicolas-lambert-tc <nicolas.lambert@technicolor.com>
@cbentejac cbentejac force-pushed the feature/viewer2d-pixel-color-xy branch from 278e95f to 663aeb8 Compare May 20, 2025 10:16
@cbentejac cbentejac merged commit 8abf166 into develop May 20, 2025
5 checks passed
@cbentejac cbentejac deleted the feature/viewer2d-pixel-color-xy branch May 20, 2025 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature new feature (proposed as PR or issue planned by dev) UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants